<template>
  <div class="hello">
    {{cp}}
  </div>
</template>

<script>

import axios from "axios";
import querystring from "querystring";
export default {
  name: 'HelloWorld',
  data(){
    return{
      cp:{}
    }
  },
  mounted(){
    //get请求方式
    // axios({
    //   method:'get',
    //   url:"http://iwenwiki.com/api/blueberrypai/getChengpinDetails.php"
    // }).then(res => {
    //   // console.log(res);
    //   this.cp = res.data.chengpinDetails[0]
    //
    // })
    //
    // axios({
    //   method:'post',
    //   url:"http://iwenwiki.com/api/blueberrypai/login.php",
    //   data:querystring.stringify({
    //     user_id:'iwen@qq.com',
    //     password:'iwen123',
    //     verification_code:'crfvw'
    //   })
    // }).then(res =>{
    //   console.log(res.data)
    // })

    axios.get('http://iwenwiki.com/api/blueberrypai/getChengpinDetails.php').then(res => {
      console.log(res.data)
    })

    axios.post('http://iwenwiki.com/api/blueberrypai/login.php',querystring.stringify({
      user_id:'iwen@qq.com',
      password: 'iwen123',
      verification_code: 'crfvw'
    })).then(res => {
      console.log(res.data)
    })




  }

}
</script>

